for a in range (10):
    a=int(input())
    print()
    if a%3 == 0:
        print(a)

